package model.magazina;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Author: Kostika Gorica
 * User:   kosta
 * Date:   3/9/13
 * Time:   8:56 PM
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
@XmlRootElement(name = "furnizim")
public class Furnizim {
    private int id;
    private int furnitoriID;
    private int operatoriID;
    private int paguar;
    @XmlElement(nillable = true)
    private Date dataFurnizimit;
    @XmlElement(nillable = true)
    private Date dataPageses;
    private double shumaFatures;
    private double taksa;
    private int magazinaID;
    @XmlElement(nillable = true)
    private String shenime;
    @XmlAnyElement(lax = true)
    @XmlElementRef(type = FurnizimDetail.class)
    @XmlElementWrapper
    private List<FurnizimDetail> detailList;

    public Furnizim(){
        this(0,0,0,0,null,null,0.0,0.0,0,"");
    }

    public Furnizim(int id, int furnitoriID, int operatoriID, int paguar, Date dataFurnizimit, Date dataPageses, double shumaFatures, double taksa, int magazinaID, String shenime) {
        this.id = id;
        this.furnitoriID = furnitoriID;
        this.operatoriID = operatoriID;
        this.paguar = paguar;
        this.dataFurnizimit = dataFurnizimit;
        this.dataPageses = dataPageses;
        this.shumaFatures = shumaFatures;
        this.taksa = taksa;
        this.magazinaID = magazinaID;
        this.shenime = shenime;
        detailList = new ArrayList<FurnizimDetail>();
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getFurnitoriID() {
        return furnitoriID;
    }

    public void setFurnitoriID(int furnitoriID) {
        this.furnitoriID = furnitoriID;
    }

    public int getOperatoriID() {
        return operatoriID;
    }

    public void setOperatoriID(int operatoriID) {
        this.operatoriID = operatoriID;
    }

    public int getPaguar() {
        return paguar;
    }

    public void setPaguar(int paguar) {
        this.paguar = paguar;
    }

    public Date getDataFurnizimit() {
        return dataFurnizimit;
    }

    public void setDataFurnizimit(Date dataFurnizimit) {
        this.dataFurnizimit = dataFurnizimit;
    }

    public Date getDataPageses() {
        return dataPageses;
    }

    public void setDataPageses(Date dataPageses) {
        this.dataPageses = dataPageses;
    }

    public double getShumaFatures() {
        return shumaFatures;
    }

    public void setShumaFatures(double shumaFatures) {
        this.shumaFatures = shumaFatures;
    }

    public double getTaksa() {
        return taksa;
    }

    public void setTaksa(double taksa) {
        this.taksa = taksa;
    }

    public int getMagazinaID() {
        return magazinaID;
    }

    public void setMagazinaID(int magazinaID) {
        this.magazinaID = magazinaID;
    }

    public String getShenime() {
        return shenime;
    }

    public void setShenime(String shenime) {
        this.shenime = shenime;
    }

    public List<FurnizimDetail> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<FurnizimDetail> detailList) {
        this.detailList = detailList;
    }

    public void addDetail(FurnizimDetail detail){
        this.detailList.add(detail);
    }
}
